


var  sp="/user/buyer/searchproduct.jsp";
var  gpga="/user/buyer/getproductgroup.jsp";
var  addorder="/user/buyer/addorder.jsp";
var  bod="/user/buyer/order_detail.jsp";
var  bos="/user/buyer/order_summary.jsp";
var  qnap="/user/buyer/newarrivalproduct.jsp";
var  obp="/user/buyer/offenbuyproduct.jsp";
var  sod="/user/seller/order_detail.jsp";
var  sos="/user/seller/order_summary.jsp";
var  aprmm="/user/seller/addproductralative.jsp";
var  prmm="/user/seller/productralative_manage.jsp";
var  pcm="/user/seller/productgroup_manage.jsp";
var  im="/user/seller/images_manage.jsp";
var  ppm="/user/seller/privateproduct_manage.jsp";
var  pm="/user/seller/product_manage.jsp";
var  pp="/user/seller/publishproduct.jsp";
var  anp="/user/seller/addnewproduct.jsp";
var  iep="/user/seller/importexistproduct.jsp";
var  aip="/user/seller/addimportproduct.jsp";
var  emm="/user/seller/employee_manage.jsp";
var  aem="/user/seller/addemployee.jsp";
var  eem="/user/seller/editemployee.jsp";
var  gpp="/user/seller/getproductparameter.jsp";
var  ppmm="/user/seller/processpayment_manage.jsp";
var  cpgm="/user/contactperson/contactpersongroup_manage.jsp";
var  eui="/user/edituserinfo.jsp";
var  acp="/user/contactperson/addcontactperson.jsp";
var  gcpg="/user/contactperson/getcontactpersongroup.jsp";
var  cpm="/user/contactperson/contactperson_manage.jsp";
var  wm="/user/message/writemessage.jsp";


function selectsubmit() {
	  if (document.all("languageSelect").value != "9999") {
	  	document.langform.submit();
	  } 
	
	}
 

function includePage(whichpage,idtoshow){
	DynamicInclude.getInclude(whichpage,function(data) {
	   dwr.util.setValue(idtoshow, data, { escapeHtml:false });
	 
	   });
	}


function includePageA(whichpage,idtoshow,ac){
	DynamicInclude.getInclude(whichpage,function(data) {
	   dwr.util.setValue(idtoshow, data+ac, { escapeHtml:false });
	 
	   });
	}

function includePageB(whichpage,idtoshow,startStr,endStr){
	DynamicInclude.getInclude(whichpage,function(data) {
	   dwr.util.setValue(idtoshow, startStr+data+endStr, { escapeHtml:false });
	 
	   });
	}



function getProductGroupManager(){

DynamicInclude.getInclude(pcm,function(data) {
	   dwr.util.setValue('seller_display', data, { escapeHtml:false });
	   queryProductGroupPage();
	   });

}
function productgrouppageselectCallback(page_id, jq){
	$('#Searchresult_productgroup').text("当前查询结果： "+((page_id*10)+1)+"-"+((page_id*10)+10));
	
	queryProductGroup((page_id*10),'10','queryproductproupresult');
}
function queryProductGroupPage(){
	
	UserAction.queryProductGroupTotalRecord(function(data){
	 
	$("#Pagination_productgroup").pagination(data, {
		num_edge_entries: 2,
		num_display_entries: 8,
		prev_text:"上一页",
		next_text:"下一页",
		callback: productgrouppageselectCallback
		} );
	});
		queryProductGroup('0','10','queryproductproupresult');
	}


function queryProductGroup(firstResult,maxResults,idtoshow){
	 	UserAction.queryProductGroup(firstResult,maxResults,function(data){
		 dwr.util.setValue(idtoshow, data, { escapeHtml:false });
		
	});
	}

function delProductGroup(id){
hiConfirm('你确认此删除操作吗?', '确认框', function(r) {
	if(r==true){
		UserAction.delProductGroup(id,function(data){
			hiOverAlert(data);
		});
    
	}
});
}

function updateProductGroup(productgroupid,pgname){

    	hiPrompt('产品组名称:', pgname, '更新产品组', function(r) {
		 if( r ) {
			UserAction.updateProductGroup(productgroupid,r,function(data){
					hiOverAlert(data);});
			 
			 	 }
		 
		 	});
	
	
	
	}

function addProductGroup(){
		hiPrompt('产品组名称:', '新产品组', '添加产品组', function(r) {
		 if( r ) {
			UserAction.addProductGroup(r,function(data){
					hiOverAlert(data);});
			 
			 	 }
		 		 	});
	}

function showAddEmployeeBox(){
	hiBox('#div_message_box', '添加新员工','650','500','','.a_close');
	includePage(aem,'popup_message');
	
}


function getEmployeeManager(){

	DynamicInclude.getInclude(emm,function(data) {
		   dwr.util.setValue('seller_display', data, { escapeHtml:false });
			
	         });
	   
	
	}

function addEmployee(){
	 var employeename=dwr.util.getValue("employeename");
     var employeegender=dwr.util.getValue("employeegender");
     var employeeage=dwr.util.getValue("employeeage");
     var employeebirthdate=dwr.util.getValue("employeebirthdate");
     var employeeidcard=dwr.util.getValue("employeeidcard");
     var employeemerriage=dwr.util.getValue("employeemerriage");
     var employeeaddress=dwr.util.getValue("employeeaddress");
     var employeephone=dwr.util.getValue("employeephone");
     var employeehiredate=dwr.util.getValue("employeehiredate");
     var employeenumber=dwr.util.getValue("employeenumber");
     var employeebankaccount=dwr.util.getValue("employeebankaccount");//
     var bank=dwr.util.getValue("employeebank");
     var department=dwr.util.getValue("employeedepartment");//
     var education=dwr.util.getValue("employeeeducation");
     var hiretype=dwr.util.getValue("employeehiretype");
     var nativeplace=dwr.util.getValue("employeenativeplace");//
     var position=dwr.util.getValue("employeeposition");
     var profession=dwr.util.getValue("employeeprofession");//
    
     if(employeename!=""&&employeebirthdate!=""&&employeeage!=""&&employeenumber!=""){
   UserAction.addEmployee(employeename,employeegender,employeebirthdate,employeeidcard,employeeage,employeemerriage,employeephone,employeeaddress,employeenumber,employeebankaccount,employeehiredate,bank,department,education,hiretype,nativeplace,position,profession,function(data){
	
	hiOverAlert(data);
});
     }

}

function checkEmployeeNumber(boxid){
	
	var employeenumber=dwr.util.getValue(boxid);
	UserAction.checkEmployeeNumber(employeenumber,function(data){rs=data;});
	
}

function checkEmployeeNumberForAdd(boxid){
	
	var employeenumber=dwr.util.getValue(boxid);
	if(employeenumber!=""&&employeenumber!="0"){
	UserAction.checkEmployeeNumber(employeenumber,function(data){
	
	if(data==true){
		 document.getElementById(boxid).className='normalinputbox'; 
	}else{
		document.getElementById(boxid).className='wronginputbox';
	}
	});
	}
}




function queryEmployeePage(){
	var employeename=dwr.util.getValue("qemployeename");
    var employeegender=dwr.util.getValue("qemployeegender");
    var employeeage=dwr.util.getValue("qemployeeage");
    var employeebirthdate=dwr.util.getValue("qemployeebirthdate");
    var employeeidcard=dwr.util.getValue("qemployeeidcard");
    var employeemerriage=dwr.util.getValue("qemployeemerriage");
    var employeeaddress=dwr.util.getValue("qemployeeaddress");
    var employeephone=dwr.util.getValue("qemployeephone");
    var employeehiredate=dwr.util.getValue("qemployeehiredate");
    var employeenumber=dwr.util.getValue("qemployeenumber");
    var employeebankaccount=dwr.util.getValue("qemployeebankaccount");//
    var bank=dwr.util.getValue("qemployeebank");
    var department=dwr.util.getValue("qemployeedepartment");//
    var education=dwr.util.getValue("qemployeeeducation");
    var hiretype=dwr.util.getValue("qemployeehiretype");
    var nativeplace=dwr.util.getValue("qemployeenativeplace");//
    var position=dwr.util.getValue("qemployeeposition");
    var profession=dwr.util.getValue("qemployeeprofession");//
    var employeestate=dwr.util.getValue("qemployeestate");
    if(employeeage==""){
    	employeeage="0";
    }
    if(employeenumber==""){
    	employeenumber="0";
    }

    
UserAction.queryEmployeeTotalRecord(employeename,employeegender,employeebirthdate,employeeidcard,employeeage,employeemerriage,employeephone,employeeaddress,employeenumber,employeebankaccount,employeehiredate,bank,department,education,hiretype,nativeplace,position,profession,employeestate,function(data){
	
	$("#Pagination_employee").pagination(data, {
		num_edge_entries: 2,
		num_display_entries: 8,
		prev_text:"上一页",
		next_text:"下一页",
		callback: employeepageselectCallback
		} );
	});
    
queryEmployee('0','10','queryemployeeresult');//初始化第一页
}






function employeepageselectCallback(page_id, jq){//点击页数所调用
	$('#Searchresult_employee').text("当前查询结果： "+((page_id*10)+1)+"-"+((page_id*10)+10));
	
	queryEmployee((page_id*10),'10','queryemployeeresult');//点击页面数调用此员工查询
}




function queryEmployee(firstResult,maxResults,idtoshow){
	var employeename=dwr.util.getValue("qemployeename");
    var employeegender=dwr.util.getValue("qemployeegender");
    var employeeage=dwr.util.getValue("qemployeeage");
    var employeebirthdate=dwr.util.getValue("qemployeebirthdate");
    var employeeidcard=dwr.util.getValue("qemployeeidcard");
    var employeemerriage=dwr.util.getValue("qemployeemerriage");
    var employeeaddress=dwr.util.getValue("qemployeeaddress");
    var employeephone=dwr.util.getValue("qemployeephone");
    var employeehiredate=dwr.util.getValue("qemployeehiredate");
    var employeenumber=dwr.util.getValue("qemployeenumber");
    var employeebankaccount=dwr.util.getValue("qemployeebankaccount");//
    var bank=dwr.util.getValue("qemployeebank");
    var department=dwr.util.getValue("qemployeedepartment");//
    var education=dwr.util.getValue("qemployeeeducation");
    var hiretype=dwr.util.getValue("qemployeehiretype");
    var nativeplace=dwr.util.getValue("qemployeenativeplace");//
    var position=dwr.util.getValue("qemployeeposition");
    var profession=dwr.util.getValue("qemployeeprofession");//
    var employeestate=dwr.util.getValue("qemployeestate");
    
    if(employeeage==""){
    	employeeage="0";
    }
    if(employeenumber==""){
    	employeenumber="0";
    }

    
UserAction.queryEmployee(firstResult,maxResults,employeename,employeegender,employeebirthdate,employeeidcard,employeeage,employeemerriage,employeephone,employeeaddress,employeenumber,employeebankaccount,employeehiredate,bank,department,education,hiretype,nativeplace,position,profession,employeestate,function(data){
	
	  dwr.util.setValue(idtoshow, data, { escapeHtml:false });
	
});
    

}


function showEditEmployeeBox(employeenumber){
	
	hiBox('#div_message_box', '编辑员工','650','500','','.a_close');
	
	UserAction.setUpdateEmployeeSession(employeenumber,function(data){
		if(data==true){
		includePage(eem,'popup_message');
		}else{
			dwr.util.setValue('popup_message','加载员工信息失败');
		}
	});
	
	
}



function updateEmployee(){
	var employeename=dwr.util.getValue("updateemployeename");
    var employeegender=dwr.util.getValue("updateemployeegender");
    var employeeage=dwr.util.getValue("updateemployeeage");
    var employeebirthdate=dwr.util.getValue("updateemployeebirthdate");
    var employeeidcard=dwr.util.getValue("updateemployeeidcard");
    var employeemerriage=dwr.util.getValue("updateemployeemerriage");
    var employeeaddress=dwr.util.getValue("updateemployeeaddress");
    var employeephone=dwr.util.getValue("updateemployeephone");
    var employeehiredate=dwr.util.getValue("updateemployeehiredate");
    var employeenumber=dwr.util.getValue("updateemployeenumber");
    var employeebankaccount=dwr.util.getValue("updateemployeebankaccount");//
    var bank=dwr.util.getValue("updateemployeebank");
    var department=dwr.util.getValue("updateemployeedepartment");//
    var education=dwr.util.getValue("updateemployeeeducation");
    var hiretype=dwr.util.getValue("updateemployeehiretype");
    var nativeplace=dwr.util.getValue("updateemployeenativeplace");//
    var position=dwr.util.getValue("updateemployeeposition");
    var profession=dwr.util.getValue("updateemployeeprofession");//
    var employeestate=dwr.util.getValue("updateemployeestate");
    if(employeename!=""&&employeebirthdate!=""&&employeeage!=""&&employeenumber!=""){
  UserAction.updateEmployee(employeename,employeegender,employeebirthdate,employeeidcard,employeeage,employeemerriage,employeephone,employeeaddress,employeenumber,employeebankaccount,employeehiredate,bank,department,education,hiretype,nativeplace,position,profession,employeestate,function(data){
	hiOverAlert(data);
});
    }

}

function checkFileType(id){
	var file=document.getElementById(id).value ;
	var length=document.getElementById(id).value.length;
	var filename="" ;
	var   rs=true;
	var t;
	for(i=0;i<length;i++){
	 var doc=file.charAt(i) ;
	 if(doc=="."){
	 t=i;
	  }
	  }
	  for(j=t ;j<length;j++){
	    filename= filename+file.charAt(j);
	     }
	    if(filename!=".JPG"&&filename!=".jpg" &&filename!=".bmp" &&filename!=".BMP"  ){
	     
	   // alert("请选择正确的图片格式!");
	    hiAlert('请选择正确的图片格式！', '注意');
	    
	    rs=false;
		 
	     }
	    return rs;
	}




function uploadEmployeePhoto() {
	  var image = dwr.util.getValue('employeephotofile');
	   var immmm=document.all.employeephotofile.value;
   if(immmm!=""&&checkFileType('employeephotofile')==true){
	  UserAction.uploadEmployeePhoto(image, function(data) {
	    dwr.util.setValue('employeephoto', data);
	  });
   }

	}
//以下三个方法用于复选框操作
function reverseSelectAllCheckBox(formid){ //返选
	var tform=document.forms[formid]; 
	for(var i=0;i<tform.length;i++){ 
	var e=tform.elements[i]; 
	if(e.type=="checkbox" ){ e.checked=!e.checked; }
	} 
	} 


	function selectAllCheckBox(formid){ //全选 
	var tform=document.forms[formid]; 
	for(var i=0;i<tform.length;i++){ 
	var e=tform.elements[i]; 
	if(e.type=="checkbox" ){ e.checked=true; }
	} 
	}

	function getAllSelectedCheckBoxValues(formid){ //返回选中值
	var tform=document.forms[formid]; 
	var t=0;
	var b=new Array();
	for(var i=0;i<tform.length;i++){ 
	var e=tform.elements[i]; 
	if(e.type=="checkbox" && e.checked==true){
	b[t]=e.value;
	t++;

	 }
	} 
	return b;
	}

	
	function getRadioBoxValue(formid){ //返回单选框选中值
		var tform=document.forms[formid]; 
		var t=0;
		var b="";
		for(var i=0;i<tform.length;i++){ 
		var e=tform.elements[i]; 
		if(e.type=="radio" && e.checked==true){
				b=e.value;
	   		 }
		} 
		return b;
		}
	
	function changeStyle(objectid){//此方法用于层的展开和合起
	if(document.getElementById(objectid).className=='normal'){
	document.getElementById(objectid).className='expend';
		}else if(document.getElementById(objectid).className=='expend'){
			document.getElementById(objectid).className='normal';
		}
	}
	
	function outputEmployeeToExcelFile(){
		var em=getAllSelectedCheckBoxValues('queryemployeeform');
		if(em.length>0){
		UserAction.outputEmployeeToExcelFile(em,function(data){});
		}else{
			hiAlert('请至少选择一个需要导出的员工 ！', '注意');
		}
		
	}
	
	
	
	
	
	function initEditor(){//此方法用于初始化文本编辑器
		$('textarea.xheditor').xheditor(true);
		
	}
	
	
	function uploadProductImage(fileid,imageid) {
		  var image = dwr.util.getValue('publishproductimagefile');
		   var file=document.getElementById(fileid).value ;
	   if(image!=""&&checkFileType(fileid)==true){
		  UserAction.uploadProductImage(image, function(data) {
		    dwr.util.setValue(imageid, data);
		  });
	   }

		}

	
	
	
	
	function addNewProduct(){
		var productcategory=dwr.util.getValue("publishproductcategory");
		var productgroup=dwr.util.getValue("publishproductgroup");
		var productmodel=dwr.util.getValue("publishproductmodel");
		var productname=dwr.util.getValue("publishproductname");
		var productdate=dwr.util.getValue("publishproductdate");
		var productcostprice=dwr.util.getValue("publishproductcostprice");
		var productprice=dwr.util.getValue("publishproductprice");
		var productdiscription=dwr.util.getValue("publishproductdiscription");
		
		if(productcategory!=0&&productgroup!=0&&productmodel!=""&&productname!=""&&productdate!=""&&productcostprice!=""&&productprice!=""&&productdiscription!=""){
		UserAction.addProduct(productcategory,productgroup,productmodel,productname,productdate,productcostprice,productprice,productdiscription,function(data){  
			
			hiOverAlert(data);//提示处理结果	
		});
		}
		
	
	}
	
	
	function showImportExistProductBox(){
		hiBox('#div_message_box', '从已有的产品中导入模板','650','500','','.a_close');
		includePage(iep,'popup_message');
		
	}
	
	function showImportSellerProductBox(){
		hiBox('#div_message_box', '从卖家分配的产品中导入模板','650','500','','.a_close');
		//includePage(aem,'popup_message');
		
	}
	
	
	function queryProudctForImportExistModel(firstResult,maxResults,idtoshow){
		var productmodel=dwr.util.getValue("searchimportproductmodel");
		var productgroup=dwr.util.getValue("searchimportproductgroup");
		UserAction.queryProduct(firstResult,maxResults,'0',productgroup,productmodel,'','','','','','a',function(data){
			 dwr.util.setValue(idtoshow, data, { escapeHtml:false });
		} );
		
	}
	
	
	function queryProudctForImportExistModelPage(){//初始化分页
		var productmodel=dwr.util.getValue("searchimportproductmodel");
		var productgroup=dwr.util.getValue("searchimportproductgroup");
		UserAction.queryProductTotalRecord('0',productgroup,productmodel,'','','','','',function(data){
		 
		$("#Pagination_importexistproduct").pagination(data, {
			num_edge_entries: 2,
			num_display_entries: 8,
			prev_text:"上一页",
			next_text:"下一页",
			callback: queryProudctForImportExistModelCallback
			} );
		});
		queryProudctForImportExistModel('0','10','searchimportproductresultcontainer');
		}

	function queryProudctForImportExistModelCallback(page_id, jq){//页码点击回调方法
		$('#Searchresult_importexistproduct').text("当前查询结果： "+((page_id*10)+1)+"-"+((page_id*10)+10));
		queryProudctForImportExistModel((page_id*10),'10','searchimportproductresultcontainer');
	}
	
	
	function importSelectedExistProduct(){
		var productid=getRadioBoxValue('queryproductform');
		if(productid!=""){
			UserAction.setUpdateProductSession(productid,function(data){
				if(data==true){
					includePage(aip,'div_publishproduct');
					initEditor();
				}
			});
		}else{
			hiAlert('请选择要导入的产品！', '注意');
		}
	}
	

	
	
	
	function queryProudct(firstResult,maxResults,idtoshow){
		var productmodel=dwr.util.getValue("searchproductmodel");
		var productgroup=dwr.util.getValue("searchproductgroup");
		var productname=dwr.util.getValue("searchproductname");
		var startproductcostprice=dwr.util.getValue("startsearchproductcostprice");
		var endproductcostprice=dwr.util.getValue("endsearchproductcostprice");
		var startproductprice=dwr.util.getValue("startsearchproductprice");
		var endproductprice=dwr.util.getValue("endsearchproductprice");
		UserAction.queryProduct(firstResult,maxResults,'0',productgroup,productmodel,productname,startproductcostprice,endproductcostprice,startproductprice,endproductprice,'b',function(data){
			 dwr.util.setValue(idtoshow, data, { escapeHtml:false });
			 initHighslide();
		} );
		
	}
	
	
	function queryProudctPage(){//初始化分页
		var productmodel=dwr.util.getValue("searchproductmodel");
		var productgroup=dwr.util.getValue("searchproductgroup");
		var productname=dwr.util.getValue("searchproductname");
		var startproductcostprice=dwr.util.getValue("startsearchproductcostprice");
		var endproductcostprice=dwr.util.getValue("endsearchproductcostprice");
		var startproductprice=dwr.util.getValue("startsearchproductprice");
		var endproductprice=dwr.util.getValue("endsearchproductprice");
		UserAction.queryProductTotalRecord('0',productgroup,productmodel,productname,startproductcostprice,endproductcostprice,startproductprice,endproductprice,function(data){
		 
		$("#Pagination_productmanage").pagination(data, {
			num_edge_entries: 2,
			num_display_entries: 8,
			prev_text:"上一页",
			next_text:"下一页",
			callback: queryProudctCallback
			} );
		});
		queryProudct('0','10','div_productmanage_rusultcontianer');
		}

	function queryProudctCallback(page_id, jq){//页码点击回调方法
		$('#Searchresult_productmanage').text("当前查询结果： "+((page_id*10)+1)+"-"+((page_id*10)+10));
		queryProudct((page_id*10),'10','div_productmanage_rusultcontianer');
	}
	
	
	
	function showContactPersonTreeBox(){
		hiBox('#div_message_box', '请选择你要指派到的联系人','500','400','','.a_close');
		var  appendstr="<input type=button value=确认  onClick=addPrivateProductBatch('queryproductform','contactpersonid')>";
		initContactPersonTree('popup_message',appendstr);
	}
	

	
	
       function getContactPersonGroupManager(){

		DynamicInclude.getInclude(cpgm,function(data) {
			   dwr.util.setValue('contactperson_display', data, { escapeHtml:false });
			   queryContactPersonGroupPage();
			   });

		}
	
	
	function contactpersongrouppageselectCallback(page_id, jq){
		$('#Searchresult_contactpersongroup').text("当前查询结果： "+((page_id*10)+1)+"-"+((page_id*10)+10));
		queryContactPersonGroup((page_id*10),'10','querycontactpersongroupresult');
	}
	
	
		function queryContactPersonGroupPage(){
			
			UserAction.queryContactPersonGroupTotalRecord(function(data){
			 
			$("#Pagination_contactpersongroup").pagination(data, {
				num_edge_entries: 2,
				num_display_entries: 8,
				prev_text:"上一页",
				next_text:"下一页",
				callback: contactpersongrouppageselectCallback
				} );
			});
				queryContactPersonGroup('0','10','querycontactpersongroupresult');
			}


		function queryContactPersonGroup(firstResult,maxResults,idtoshow){
			 	UserAction.queryContactPersonGroup(firstResult,maxResults,function(data){
				 dwr.util.setValue(idtoshow, data, { escapeHtml:false });
				
			});
			}

		function delContactPersonGroup(id){
		hiConfirm('你确认此删除操作吗?', '确认框', function(r) {
			if(r==true){
				UserAction.delContactPersonGroup(id,function(data){
					hiOverAlert(data);
				});
		    
			}
		});
		}

		function updateContactPersonGroup(id,name){

		    	hiPrompt('联系人组名称:', name, '更新联系人组', function(r) {
				 if( r ) {
					UserAction.updateContactPersonGroup(id,r,function(data){
							hiOverAlert(data);});
					 
					 	 }
				 
				 	});
			
			
			
			}

		function addContactPersonGroup(){
				hiPrompt('联系人组名称:', '新联系人组', '添加联系人组', function(r) {
				 if( r ) {
					UserAction.addContactPersonGroup(r,function(data){
							hiOverAlert(data);});
					 
					 	 }
				 		 	});
			}
	
	
		
		
		
		function queruserpageselectCallback(page_id, jq){
			$('#Searchresult_queryuser').text("当前查询结果： "+((page_id*10)+1)+"-"+((page_id*10)+10));
			queryUser((page_id*10),'10','queryuserresult');
		}
		
		
			function queryUserPage(){
				var userName= dwr.util.getValue("queryusername") ;
				var userAddress= dwr.util.getValue("queryuseraddress");
				
				UserAction.queryUserTotalRecord(userName,userAddress,function(data){
				 
				$("#Pagination_queryuser").pagination(data, {
					num_edge_entries: 2,
					num_display_entries: 8,
					prev_text:"上一页",
					next_text:"下一页",
					callback: queruserpageselectCallback
					} );
				});
					queryUser('0','10','queryuserresult');
				}


			function queryUser(firstResult,maxResults,idtoshow){
				var userName= dwr.util.getValue("queryusername") ;
				var userAddress= dwr.util.getValue("queryuseraddress");
				
				 	UserAction.queryUser(firstResult,maxResults,userName,userAddress,function(data){
					 dwr.util.setValue(idtoshow, data, { escapeHtml:false });
					
				});
				}
			
			
	
			
			
			function showAddToContactPersonBox(userid,state){
				hiBox('#div_message_box', '请选择联系人组','300','100','','.a_close');
				var content='<input type="button" value="添加" onClick=" addToContactPerson('+userid+',\'0\') ">';
				includePageA(gcpg,'popup_message',content);
				
			}
			
			function showAgreeAddToContactPersonBox(userid,state){
				hiBox('#div_message_box', '请选择联系人组','300','100','','.a_close');
				var content='<input type="button" value="添加" onClick="agreeAddToContactPerson('+userid+',\'1\') ">';
				includePageA(gcpg,'popup_message',content);
				
			}
			function agreeAddToContactPerson(userid,state){
				
				var contactpersongroupId= dwr.util.getValue("setcontactpersongroup");
				if(contactpersongroupId!="0"){
				UserAction.agreeAddToContactPerson(userid,contactpersongroupId,state,function(data){
					hiAlert(data, '注意');
				});
				}
			}
	
			function addToContactPerson(userid,state){
				var contactpersongroupId= dwr.util.getValue("setcontactpersongroup");
				if(contactpersongroupId!="0"){
				UserAction.addToContactPerson(userid,contactpersongroupId,state,function(data){
					hiAlert(data, '注意');
				});
				}
			}
			
		
			function showUpdateGroupOfContactPersonBatchBox(){
				hiBox('#div_message_box', '请选择联系人组','300','100','','.a_close');
				var content='<input type="button" value="更新" onClick="updateGroupOfContactPersonBatch() ">';
				includePageA(gcpg,'popup_message',content);
				
			}

			function updateGroupOfContactPersonBatch(){
			var contactpersongroupId= dwr.util.getValue("setcontactpersongroup");
			var cp=getAllSelectedCheckBoxValues('querycontactpersonform');
			if(cp.length>0&&contactpersongroupId!=0){
			UserAction.updateGroupOfContactPersonBatch(cp,contactpersongroupId,function(data){
				hiAlert(data, '注意');
			});
			}else{
				hiAlert('请至少选择一个需要调整的联系人 ！', '注意');
			}
		}
		
			
/////////////////////////////////////////////////////////////////			
			function querycontactpersonpageselectCallback(page_id, jq){
				$('#Searchresult_querycontactperson').text("当前查询结果： "+((page_id*10)+1)+"-"+((page_id*10)+10));
				queryContactPerson((page_id*10),'10','querycontactpersonresult');
			}
			
			
				function queryContactPersonPage(){
					var querycontactpersonname= dwr.util.getValue("querycontactpersonname") ;
					var querycontactpersonstate= dwr.util.getValue("querycontactpersonstate");
					UserAction.queryContactPersonTotalRecord(querycontactpersonname,querycontactpersonstate,function(data){
					 
					$("#Pagination_querycontactperson").pagination(data, {
						num_edge_entries: 2,
						num_display_entries: 8,
						prev_text:"上一页",
						next_text:"下一页",
						callback: querycontactpersonpageselectCallback
						} );
					});
					queryContactPerson('0','10','querycontactpersonresult');
					}


				function queryContactPerson(firstResult,maxResults,idtoshow){
					var querycontactpersonname= dwr.util.getValue("querycontactpersonname") ;
					var querycontactpersonstate= dwr.util.getValue("querycontactpersonstate");
					UserAction.queryContactPerson(firstResult,maxResults,querycontactpersonname,querycontactpersonstate,function(data){
						 dwr.util.setValue(idtoshow, data, { escapeHtml:false });
						});
					}
				
//////////////////////////////////////////////////////////////
				
				
				function queryimagespageselectCallback(page_id, jq){
					$('#Searchresult_imagesmanage').text("当前查询结果： "+((page_id*10)+1)+"-"+((page_id*10)+10));
					queryImages((page_id*10),'10','div_imagesmanage_rusultcontianer');
				}
				
				
					function queryImagesManagePage(){
						var imageuploadstartdate= dwr.util.getValue("imageuploadstartdate") ;
						var imageuploadenddate= dwr.util.getValue("imageuploadenddate");
						UserAction.queryImagesTotalRecord(imageuploadstartdate,imageuploadenddate,function(data){
						 
						$("#Pagination_imagesmanage").pagination(data, {
							num_edge_entries: 2,
							num_display_entries: 8,
							prev_text:"上一页",
							next_text:"下一页",
							callback: queryimagespageselectCallback
							} );
						});
						queryImages('0','10','div_imagesmanage_rusultcontianer');
						}


					function queryImages(firstResult,maxResults,idtoshow){
						var imageuploadstartdate= dwr.util.getValue("imageuploadstartdate") ;
						var imageuploadenddate= dwr.util.getValue("imageuploadenddate");
						UserAction.queryImages(firstResult,maxResults,imageuploadstartdate,imageuploadenddate,function(data){
							 dwr.util.setValue(idtoshow, data, { escapeHtml:false });
							 initHighslide();
							});
						}
					
		
/////////////////////////////////////////////////////////////////////////	
					
					function initHighslide(){//初始化插件
						hs.graphicsDir = 'user/plugin/highslide/graphics/';
						hs.align = 'center';
						hs.transitions = ['expand', 'crossfade'];
						hs.outlineType = 'rounded-white';
						hs.wrapperClassName = 'controls-in-heading';
						hs.fadeInOut = true;
						//hs.dimmingOpacity = 0.75;

						// Add the controlbar
						if (hs.addSlideshow) hs.addSlideshow({
							//slideshowGroup: 'group1',
							interval: 5000,
							repeat: false,
							useControls: true,
							fixedControls: false,
							overlayOptions: {
								opacity: 1,
								position: 'top right',
								hideOnMouseOut: false
							}
						});
					}
	//////////////////////////////////////////////////////////////////
					
					
					function delImages(id){
						hiConfirm('你确认此删除操作吗?', '警告', function(r) {
							if(r==true){
								UserAction.delImages(id,function(data){
									hiAlert(data);
								});
						    
							}
						});
						}
					
					
/////////////////////////////////////////////////////////////////////
									